import { Controller, Get } from "@nestjs/common";
import { HardwareService } from "./hardware.service";
import { MockTransportServerService } from "./mock-socket-server/mock-transport-server.service";
import { TransportClientService } from "./transport-client/transport-client.service";
import { EventPattern, MessagePattern } from "@nestjs/microservices";
import { EnumMicroService, SysIntervalMsgType } from "../../../types/types";

@Controller()
export class HardwareController {
  constructor(private readonly hardwareService: HardwareService) {}

  @Get()
  getHello(): string {
    return this.hardwareService.getHello();
  }

  @MessagePattern(SysIntervalMsgType.SEND_TO_HARDWARE_MSG_EVENT)
  handleMessage(data: any) {
    console.log("收到需要发送给硬件的消息:", data);
  }
}
